#ifndef NODE_AFFILIATE_H
#define NODE_AFFILIATE_H
#include "screen.h"
#include "enum.h"
class node_affiliate: public node{
protected:
    screen *parent_ = nullptr;
    std::vector<screen *> children_;
    glm::vec2 offset_ = glm::vec2(0, 0);
    glm::vec2 size_ = glm::vec2(0, 0);
    Anchor anchor_ = Anchor::ANCHOR_CENTER;
public:
    screen *get_parent() { return parent_; }
    // 设置父节点
    void setParent(screen *parent) { parent_ = parent; }
    std::vector<screen *> get_children() { return children_; }
    void set_children(std::vector<screen *> children) { this->children_ = children; }
    glm::vec2 get_offset() { return offset_; }
    void set_offset(glm::vec2 offset) { this->offset_ = offset; }
    glm::vec2 getSize() { return size_; }
    void setSize(glm::vec2 size);
    void setOffsetByAnchor(Anchor anchor);
    void setScale(float scale);
    void setAnchor(Anchor anchor) { anchor_ = anchor; };
};


#endif // NODE_AFFILIATE_H